home *** CD-ROM | disk | FTP | other *** search
- Path: news.mindlink.net!news
- From: genew@mindlink.bc.ca (Gene Wirchenko)
- Newsgroups: comp.lang.c
- Subject: Re: Fastest way to computer log(base2) of x?
- Date: Wed, 07 Feb 1996 00:29:51 GMT
- Organization: MIND LINK! - British Columbia, Canada
- Message-ID: <4f8rtu$1ib@fountain.mindlink.net>
- References: <4e61iu$p6e@villa.fc.net> <4e72il$dvl@ns.RezoNet.NET> <4f647p$lc5@druid.borland.com> <9602061633.AA15316@dxmint.cern.ch>
- NNTP-Posting-Host: line341.nwm.mindlink.net
- X-Newsreader: Forte Free Agent 1.0.82
-
- Dan Pop <danpop@mail.cern.ch> wrote:
-
- >pete@borland.com (Pete Becker) writes:
-
- >>Still faster: use a table with INT_MAX entries and remove all of the
- >>conditionals. Why do the responses here assume that sacrificing speed for
- >>space savings is appropriate? The question asks for the fastest, not something
- >>that's reasonably fast but doesn't use much space.
-
- >Initializing a table with 2147483648 entries might take quite a lot of
- >time. That is, assuming that the system is configured with enough virtual
- >memory :-)
-
- >Dan
- >--
- >Dan Pop
- >CERN, CN Division
- >Email: danpop@mail.cern.ch
- >Mail: CERN - PPE, Bat. 31 R-004, CH-1211 Geneve 23, Switzerland
-
- That's only 2 to the 31st. You'd need 2 to 32nd. It also
- wouldn't be portable code. What if another platform uses (say) 64
- bits?
-
- Sincerely,
-
- Gene Wirchenko
-
- C Pronunciation Guide:
- y=x++; "wye equals ex plus plus semicolon"
- x=x++; "ex equals ex doublecross semicolon"
-
-